//首页侧边栏动画
let fadeModel = function fade() {
    let left = document.querySelector(".left");
    let right = document.querySelector(".right");
    //检查菜单滚动
    let checkFade = function () {
        document.querySelector(".nav-left").onclick = function () {
            if (document.getElementsByTagName("body")[0].clientWidth > 773) {
                if (left.style.left === "-228px") {
                    left.style.left = "0";
                    right.style.paddingLeft = "220px";
                } else {
                    left.style.left = "-228px";
                    right.style.paddingLeft = "0";
                }
            }
            else {
                let leftModel = document.querySelector(".left-model");
                if (leftModel.style.left === "-308px" || leftModel.style.left === "") {
                    leftModel.style.left = "0";
                } else {
                    leftModel.style.left = "-308px";
                }
            }
        };
        document.querySelector(".left-model-header").onclick = function () {
            let leftModel = document.querySelector(".left-model");
            if (leftModel.style.left === "-308px") {
                leftModel.style.left = "0";
            } else {
                leftModel.style.left = "-308px"
            }
        }
    };

    //修复右边内容页到达773px时paddingLeft等于220px
    let changeRightPadding = function () {
        if (document.getElementsByTagName("body")[0].clientWidth < 773) {
            right.style.paddingLeft = "0";
            left.style.left = "-228px";
        } else {
            if (right.style.paddingLeft === "0px") {
                left.style.left = "-228px";
            }
        }
    };

    let startMenuShow = function () {
        if (document.getElementsByTagName("body")[0].clientWidth > 773) {
            left.style.left = "0";
            right.style.paddingLeft = "220px";
        }
    };

    return {
        checkFade: checkFade,
        startMenuShow: startMenuShow,
        changeRightPadding: changeRightPadding
    }
};